package cn.melonlib.graphql.model.metadata;

import cn.melonlib.graphql.annos.GraphqlField;
import cn.melonlib.graphql.annos.GraphqlType;
import lombok.Data;

@Data
@GraphqlType(namespaces = "GraphqlMetadata",comment = "graphql元数据字段描述")
public class GraphqlFieldBean {

    public GraphqlFieldBean(String name, String type, String comment, boolean required, boolean requiredBody, boolean list) {
        this.name = name;
        this.type = type;
        this.comment = comment;
        this.required = required;
        this.requiredBody = requiredBody;
        this.list = list;
    }

    @GraphqlField(comment = "字段名称")
    private String name;

    @GraphqlField(comment = "字段类型")
    private String type;

    @GraphqlField(comment = "字段注释")
    private String comment;

    @GraphqlField(comment = "字段是否必填")
    private boolean required;

    @GraphqlField(comment = "字段为列表时，内容是否必填")
    private boolean requiredBody;

    @GraphqlField(comment = "字段是否为列表")
    private boolean list;
}
